<template>
    <div calss=''>
        <el-select v-for="select in mockList" :key="select.model" v-model="selectModel[select.model]" placeholder="Select" size="large">
            <el-option v-for="item in select.options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-button @click="submit">提交</el-button>
    </div>
</template>
    
<script setup>
import { onMounted ,ref} from 'vue';
const mockList = [
    {
        model: 'name',
        options: [
            { value: "01", label: '张三111' },
            { value: "02", label: '李四' },
            { value: "03", label: '小红' },
            { value: "04", label: '小明' },
        ]
    },
    {
        model: 'sex',
        options: [
            { value: "01", label: '男' },
            { value: "02", label: '女' },
        ]
    },
    {
        model: 'age',
        options: [
            { value: "01", label: '18' },
            { value: "02", label: '28' },
            { value: "03", label: '38' },
        ]
    },
]
const selectModel = ref({})
const submit = ()=>{
    console.log(selectModel.value);
}
</script>
    
<style scoped></style>